<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="schronisko.*,Users.*"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="styles/notes.css">
<title>Oceny</title>
</head>
<body>
	<a href="index.jsp"> Powrot do strony glownej</a>
	<br>
	<br>
	<center>
	<%
	Queries q = new Queries();
	int i = 1;
	ResultSet r = q.getNotes();
	float sum = 0;
	%>
		<h1>Opinie wystawione przez klientow eSchroniska</h1><br><br>
		<% if(r.next()){ %>
		<%
		}
		do{
		%>
		<div class='note'>
			<div class='id'><%=i %></div>
			<div class='autor'><%=r.getString("name")+" "+r.getString("surname") %></div>
			<div class='text'><%=r.getString("text") %></div>
			<div class='note_val'><%=r.getInt("note") %></div>
			<div class='date'><%=r.getDate("date") %></div>
		</div>
		<br><br>
		<%
		sum += r.getFloat("note");
		i++;
		}
		while(r.next());
		float mean = sum/(i-1);
		%>
	</center>
	<div class='mean'>
	<h4>Srednia ocen: 
	<%=mean %>
	</h4>
	</div>
</body>
</html>